﻿using Growatt.WaveData;
using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace Vosc
{
	// Token: 0x0200000A RID: 10
	internal class SystemSetting
	{
		// Token: 0x06000055 RID: 85 RVA: 0x000073F6 File Offset: 0x000055F6
		private SystemSetting()
		{
		}

		// Token: 0x06000056 RID: 86 RVA: 0x00007400 File Offset: 0x00005600
		static SystemSetting()
		{
			SystemSetting.Channels = new Dictionary<int, ChannelSeting>();
			for (int i = 1; i < SystemSetting.CHANNEL_COUNT + 1; i++)
			{
				SystemSetting.Channels.Add(i, new ChannelSeting());
			}
			SystemSetting.INTERNAL_DATA_DIR = Application.StartupPath + "\\internaldata";
			SystemSetting.maxPointCountOfFile = 100000;  //默认是
			SystemSetting.DataSavedFileName = null;
		}

		// Token: 0x06000057 RID: 87 RVA: 0x0000748C File Offset: 0x0000568C
		public static bool IsSettingValid()
		{
			if (string.IsNullOrEmpty(SystemSetting.PortName))
			 {
				return false;
			}
			if (SystemSetting.BaudRate == null || SystemSetting.BaudRate.Value <= 0)
			{
				return false;
			}
			if (SystemSetting.SampleFrenquency == null || SystemSetting.SampleFrenquency <= 0)
			{
				return false;
			}
			if (SystemSetting.Channels == null || SystemSetting.Channels.Count <= 0)
			{
				return false;
			}
			int num = 0;
			foreach (ChannelSeting channelSeting in SystemSetting.Channels.Values)
			{
				if (channelSeting.Address != null && channelSeting.Address != 0)
				{
					num++;
				}
			}
			return num > 0;
		}

		// Token: 0x04000085 RID: 133
		private static  int CHANNEL_COUNT = Program.CountChannel;

		// Token: 0x04000086 RID: 134
		public static readonly string INTERNAL_DATA_DIR;

		// Token: 0x04000087 RID: 135
		public static string PortName = null;

		// Token: 0x04000088 RID: 136
		public static int? BaudRate = null;

		// Token: 0x04000089 RID: 137
		public static int? SampleFrenquency = null;

        public static byte ScopeMode =0;

        // Token: 0x0400008A RID: 138
        public static Dictionary<int, ChannelSeting> Channels;

		// Token: 0x0400008B RID: 139
		public static bool isSaveDataToFile =false;

		// Token: 0x0400008C RID: 140
		public static int maxPointCountOfFile;

		// Token: 0x0400008D RID: 141
		public static string DataSavedFileName = null;
	}
}
